<?php
namespace app\api\controller;
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods:POST,GET");

use app\common\controller\HomeBase;
use app\common\model\ShouyePartner as PartnerModel;
use think\Db;

/**
 * 首页合作伙伴
 * Class Index
 * @package app\admin\controller
 */
class Partner extends HomeBase
{
    protected function _initialize(){
        parent::_initialize();
        $this->partner_model = new PartnerModel();
    }

    /**
    *首页合作者
    *@return json
    **/
    public function getpartner()
    {
    	$this->request->param('limit') ? $limit = $this->request->param('limit') : $limit = 6;
        $list = $this->partner_model->where('status',1)->limit($limit)->order('create_time','desc')->select();
        if($list){
        	$this->apiSuccess($list);
        }else{
      		$this->apiError('没有查到合作伙伴信息');
        }
    }



}